﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace OttawaTourMap.Helpers
{
    public class TourDataParser
    {
        
        /*var tours = from list in xdoc.Elements("toursList")
                    select list.Elements("tour");

        var tour = tours.First();

        var title = tour.Elements("title").First().Value;

        var desc = tour.Elements("description").First().Value;

        var stop = tour.Elements("stop").First().Value;

        var stopTitle = stop.Elements("title").First().Value;

        var stopDescription = stop.Elements("description").First().Value;

        var stopLocation = stop.Elements("location").First().Value;

        var stopLat = stopLocation.Elements("latitude").First().Value;

        var stopLong = stopLocation.Elements("longitude").First().Value;


        //second option

        var tours = from tour in toursListElement.Elements("tour")
                    select new Tour
                    {
                        Description = tour.Element("description"),
                        Stops = (from stop in tour.Elements("stop")
                                 select new Stop
                                 {
                                     Title = stop.Element("title"),
                                     Description = stop.Element("description"),
                                     Location = new Location
                                     {
                                         Latitude = stop.Element("location").Element("latitude"),
                                         Longitude = stop.Element("location").Element("longitude")
                                     }
                                 }).ToList()
                    };

        */

    }
}
